<%@ include file="IsAdmin.jsp"%><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<%
	String title = "SPMS: Homepage";
        
%>
<title><%=title%></title>
<link href="css/stylesheet.css" rel="stylesheet" type="text/css" />
<%@ include file="../master\head.jsp"%>

</head>
<body onload="start()">
<div id="container">
<div id="wrapper">
<div id="sidebar">
<div id="sb_top"><%@ include file="../master\sbTop.jsp"%>
</div>

<div class="sb_content"><!--##########--> <!-- Start Menu --> <%@ include
	 file="..\master\adminMenu.jsp"%> <!-- Profile -->
<%@ include file="..\master\profile.jsp"%> <!-- links -->
<%@ include file="..\master\links.jsp"%>
<div class="copyright"><%@ include file="../master\copyright.jsp"%>
</div>

</div>
<!-- /sb_content --></div>
<!-- /sidebar --> <!-- Top -->
<div id="header"><%@ include file="../master\header.jsp"%>
</div>


<!-- Start main content -->
<div id="content">
<div id="intro">
<div class="intro_t">
<h1><span>..</span>Welcome to<span>..</span></h1>
<h2>student project managment system</h2>

</div>
</div>
<!-- /intro -->

<h1>Control site actions</h1>
<script>
    var div;
    var name = new Array();
    var value = new Array();

</script>

<%@ page import="java.sql.*,database.*"%>
<%

DBCon db = new DBCon();

ResultSet rs = db.getControl();
String name = "";
String value = "";
out.println("<script>");
for(int i=0; rs.next();i++)
 {
    out.println("name["+i+"] = '"+rs.getString("name")+"';");
    out.println("value["+i+"] = '"+rs.getString("value")+"';");

}
   
out.println("</script>");
%>

<div id="cont"></div>

<script>

    function start()
    {
        
        document.getElementById("cont").innerHTML = "<form name='control' action='updatePermission.jsp' method='post'><input id='uncheck' type='checkbox' name='professor_reg' value='professor_reg' /> Allow professor registration<br/><input id='uncheck' type='checkbox' name='student_reg' value='student_reg' /> Allow student registration<br/><input id='uncheck' type='checkbox' name='professor_login' value='professor_login' /> Allow professor to sign in<br/><input id='uncheck' type='checkbox' name='student_login' value='student_login' /> Allow student to sign in<br/><input id='uncheck' type='checkbox' name='professor_update' value='professor_update' /> Allow professor to update profile<br/><input id='uncheck' type='checkbox' name='student_update' value='student_update' /> Allow student to update profile<br/><input id='uncheck' type='checkbox' name='project_add' value='project_add' /> Allow professor to add new project<br/><input id='uncheck' type='checkbox' name='project_update' value='project_update' /> Allow professor to update exist project<br/><input id='uncheck' type='checkbox' name='assign_project' value='assign_project' /> Allow committee to assign project to student<br/><input id='uncheck' type='checkbox' name='choose_project' value='choose_project' /> Allow student to choose projects<br/><input id='uncheck' type='checkbox' name='control_project' value='control_project' /> Allow committee to control projects<br/><input id='uncheck' type='checkbox' name='change_gpa' value='change_gpa' />Allow committee to change students GPA<br/><br /><input type='submit' value='Update' /><br /><br /></form>";

        
        for(var m=0; m < name.length; m++)
        {
            eval("document.control."+name[m]+".checked ="+ value[m]);

        }   
    }
</script>
</div>
<!-- /content --></div>
<!-- /wrapper -->
<div class="clear">&nbsp;</div>
<!-- Important! Fix the problem of height in Firefox --></div>
<!-- /Container -->


</body>
</html>